import { Organization } from "@/modules/organization/models/organization.entity";
import { IsNotEmpty } from "class-validator";
import { Column, Entity,  ManyToOne, PrimaryGeneratedColumn } from "typeorm";


@Entity('org_image')
export class OrgImage{
    @PrimaryGeneratedColumn('uuid')
      id: string;
      @Column({
        type:'text',
        comment:'地址'
      })
      @IsNotEmpty()
      url:string;
      @Column({
        comment:'remark',
        nullable:true,
      })
      remark:string;

      // 这里写上关联关系：多对一
      @ManyToOne(()=>Organization,(org)=>org.orgFrontImg)
      orgIdForFront:Organization;
      @ManyToOne(()=>Organization,(org)=>org.orgRoomImg)
      orgIdForRoom:Organization;
      @ManyToOne(()=>Organization,(org)=>org.orgOtherImg)
      orgIdForOther:Organization;
}